package com.gxks.lhs.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 订单表
 * </p>
 *
 * @author LuoHaisong
 * @since 2023-06-05
 */
@Getter
@Setter
@Accessors(chain = true)
@ApiModel(value = "Order对象", description = "订单表")
@TableName("t_order")
public class Order implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("订单ID，主键")
    @TableId(value = "id", type = IdType.AUTO)
    private String id;

    @ApiModelProperty("出售者id")
    private String sellerId;

    @ApiModelProperty("出售者用户名")
    private String sellerName;

    @ApiModelProperty("下单者ID，外键关联用户表")
    private String buyerId;

    @ApiModelProperty("下单者的用户名（冗余）")
    private String buyerName;

    @ApiModelProperty("商品id")
    private String productId;

    @ApiModelProperty("商品首图")
    private String pic;

    @ApiModelProperty("商品名称（冗余）")
    private String productName;

    @ApiModelProperty("地址id")
    private Integer addressBookId;

    @ApiModelProperty("订单总价")
    private BigDecimal totalPrice;

    @ApiModelProperty("订单状态，0表示已取消，1表示待支付，2表示已支付，3表示已发货，4表示已完成，")
    private Integer status;

    @ApiModelProperty("下单时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty("支付时间")
    private LocalDateTime payTime;

    @ApiModelProperty("支付方式")
    private String payType;

    @ApiModelProperty("支付方式名称")
    private String payName;

    @ApiModelProperty("最后更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @ApiModelProperty("物流单号")
    private String logisticsNum;

    @ApiModelProperty("备注")
    private String remarks;


}
